#include "rectangle.h"

Rectangle::Rectangle(std::vector<double> &data)
{
    x = data[0];
    y = data[1];
    width = data[2];
    height = data[3];
}

void Rectangle::setCoord(std::vector<double> &data)
{
    x = data[0];
    y = data[1];
    width = data[2];
    height = data[3];
}

std::vector<double> Rectangle::getCoord()
{
    std::vector<double> data;
    data.push_back(x);
    data.push_back(y);
    data.push_back(width);
    data.push_back(height);
    return data;
}

void Rectangle::shift(double shiftX, double shiftY)
{
    x += shiftX;
    y += shiftY;
}

typeFigure Rectangle::type()
{
    return rectangle;
}

std::string Rectangle::dataToString()
{
    return "Rectangle " + std::to_string(x) + " " + std::to_string(y)
                        + " " + std::to_string(width) + " " + std::to_string(height);
}
